package com.miracle9.game.thread;

import com.miracle9.game.service.UserService;
import com.miracle9.game.util.MyApplicationContext;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.mina.core.session.IoSession;
import org.springframework.context.ApplicationContext;

public class UserRunnable
{
  private static ExecutorService aq = Executors.newFixedThreadPool(5);
  public static void RunnableAfterLogin(final IoSession session)
  {
    aq.execute(new Runnable()
    {
      public void run()
      {
        try
        {
          Thread.sleep(3000L);
        }
        catch (InterruptedException e)
        {
          e.printStackTrace();
        }
        UserService userService = (UserService)
        MyApplicationContext.a().getBean("userService");
        userService.afterLogin(session);
      }
    });
  }
}
